﻿@{
    ViewData["Title"] = "电子档案检索";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section head{
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet" />
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" />

    <link href="/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
    <link href="/css/animate.min.css" rel="stylesheet" />
    <link href="/css/style.min.css?v=4.1.0" rel="stylesheet" />
    <style type="text/css">
        .dSearch .btn {
            margin-top: 10px;
        }

        .dataTables_wrapper {
            padding-bottom: 0px;
        }

        div.dataTables_scrollBody table {
            margin-top: -18px !important;
        }

        .fixed-table-pagination .pagination-detail, .fixed-table-pagination div.pagination {
            margin-bottom: 0px;
        }

        #dSearch table tr td {
            padding: 8px;
        }

        #dSearch .input-group {
            width: 100%;
            margin-bottom: 16px;
        }

        #dSearch .input-group-addon {
            width: 100px;
        }

        #dSearch .fix-border {
            border-left: none;
            border-right: none;
        }

        .dSearch .form-control {
            display: inline-block;
        }

        .dSearcha a.btn {
            margin-top: 0;
        }
    </style>
}
<form id="form1" runat="server">
    <div id="dMain">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="ibox" style="margin-bottom: 0px;">
                <div class="ibox-title">
                    <h5> 电子档案</h5>
                    <div class="ibox-tools">
                        <a class="btn btn-primary btn-circle btn-outline" title="刷新" href="javascript:location.href=location.href;" style="margin-top: -7px;"> <i class=" fa fa-refresh"> </i> </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="dSearch dSearcha">
                        <asp:TextBox ID="txtFileNo" runat="server" CssClass="form-control" placeholder="档号" Width="120"> </asp:TextBox>
                        <asp:DropDownList ID="ddlFTerm" runat="server" CssClass="form-control" Width="100"> </asp:DropDownList>
                        <asp:TextBox ID="txtAY" runat="server" CssClass="form-control" placeholder="题名" Width="200"> </asp:TextBox>
                        <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn btn-sm btn-primary" OnClick="lbtnSearch_Click"> <i class="icon-search"> </i> &nbsp;快速检索</asp:LinkButton>
                        <a id="ShowSearch" class="btn btn-sm btn-primary" onclick="ShowDivOfPage('#myModal','综合检索',500,510)"> <i class="icon-search"> </i> &nbsp;综合检索</a>
                        <asp:LinkButton ID="lbtnAll" runat="server" CssClass="btn btn-sm btn-primary" OnClick="lbtnAll_Click"> <i class="icon-table"> </i> &nbsp;查看全部</asp:LinkButton>
                    </div>
                    <div id="toolbar" class="dSearch">
                        <%if (IsEdit == 1) {
                        %> <a id="ShowAdd" class="btn btn-sm btn-primary ShowAdd" onclick="showPage('电子文件电子档案信息','/scan5/EleFileEdit.aspx',800,550,true)">
                            <i class="icon-pencil"></i>&nbsp;
                            添加信息
                        </a> <%
                        }

                        % >
                        <span class="text-danger" style="font-size: 14px; position: absolute; margin-top: -25px; margin-left: 250px;"> <i class="fa fa-hand-o-right"> </i> &nbsp;提示：双击行可在线预览该电子文件的附件！</span>
                    </div>
                    <table id="tabData" class="table table-bordered" style="width: 2000px;">
                        <thead>
                            <tr>
                                <th> #</th>
                                <th> 档号</th>
                                <th> 责任者</th>
                                <th> 文号</th>
                                <th> 题名</th>
                                <th> 归档年度</th>
                                <th> 保管期限</th>
                                <th> 件号</th>
                                <th> 归档日期</th>
                                <th> 形成时间</th>
                                <th> 密级</th>
                                <th> 备注</th>
                                <th> 操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div id="myModal" style="display: none;">
        <div id="dSearch" class="modal-body" style="height: 415px;">
            <div class="input-group">
                <span class="input-group-addon"> 档号</span>
                <asp:TextBox ID="txtDH" runat="server" CssClass="form-control"> </asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 目录号</span>
                <asp:TextBox ID="txtMLH" runat="server" CssClass="form-control"> </asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 责任者</span>
                <asp:TextBox ID="txtBlamer1" runat="server" CssClass="form-control"> </asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 文号</span>
                <asp:TextBox ID="txtBlamer2" runat="server" CssClass="form-control"> </asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 题名</span>
                <asp:TextBox ID="txtRealExp" runat="server" CssClass="form-control"> </asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 形成时间</span>
                <asp:TextBox ID="txtFormDate1" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyyMMdd',errDealMode:3})"> </asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;"> 至</span>
                <asp:TextBox ID="txtFormDate2" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyyMMdd',errDealMode:3})"> </asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 密级</span>
                <asp:DropDownList ID="ddlSecretLevel" runat="server" CssClass="form-control"> </asp:DropDownList>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 保管期限</span>
                <asp:DropDownList ID="ddlTerm" runat="server" CssClass="form-control"> </asp:DropDownList>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 件号</span>
                <asp:TextBox ID="txtItemNo1" runat="server" CssClass="form-control" dataType="zzs" Msg="件号格式不正确!"> </asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;"> 至</span>
                <asp:TextBox ID="txtItemNo2" runat="server" CssClass="form-control" dataType="zzs" Msg="件号格式不正确!"> </asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 归档年度</span>
                <asp:TextBox ID="txtReturnYear1" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyy'})"> </asp:TextBox>
                <span class="input-group-addon fix-border fix-padding" style="width: 30px;"> 至</span>
                <asp:TextBox ID="txtReturnYear2" runat="server" CssClass="form-control" onclick="WdatePicker({dateFmt:'yyyy'})"> </asp:TextBox>
            </div>
            <div class="input-group">
                <span class="input-group-addon"> 全宗号</span>
                <asp:TextBox ID="txtQZH" runat="server" CssClass="form-control"> </asp:TextBox>
            </div>
            <div class="input-group" style="margin-bottom: 0px;">
                <span class="input-group-addon"> 备注</span>
                <asp:TextBox ID="txtRemark" runat="server" CssClass="form-control"> </asp:TextBox>
            </div>

        </div>
        <div class="modal-footer">
            <asp:Button ID="btnSearch" runat="server" CssClass="btn btn-primary btn-sm" OnClientClick="return verfic('tip', '#dSearch');" OnClick="btnSearch_Click" Text="检索" />
                <input id="btnClose" type="button" class="btn btn-default btn-sm" value="取消" onclick="CloseDiv()" />
        </div>
    </div>
</form>
@section scripts{
    <script src="/js/jquery.min.js?v=2.1.4"></script>
    <script src="/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/js/plugins/jeditable/jquery.jeditable.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table-export.js"></script>
    <script src="/js/plugins/bootstrap-table/tableExport.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table-cookie.js"></script>

    <script src="/js/My97DatePicker/WdatePicker.js"></script>
    <script src="/js/plugins/layer/layer.min.js"></script>
    <script src="/js/verification.js"></script>
    <script src="/js/zuiCode.js"></script>

    <script type="text/javascript">
        $(function () {
            var tabHeight = document.documentElement.clientHeight - 130;
            $('#tabData').bootstrapTable({
                height: tabHeight,
                data: $("#dJson").text() != "" ? JSON.parse($("#dJson").text()) : "",
                dataType: "json",
                columns: [
                    { align: 'center', width: "50px", checkbox: true },
                    { field: 'DH', align: 'center', width: "100px", sortable: true },
                    { field: 'Blamer1', align: 'left', width: "150px", sortable: true },
                    { field: 'Blamer2', align: 'left', width: "150px", sortable: true },
                    { field: 'RealExp', align: 'left' },

                    { field: 'ReturnYear', align: 'center', width: "80px", sortable: true },
                    { field: 'Term', align: 'center', width: "100px", sortable: true },
                    { field: 'ItemNo', align: 'center', width: "80px", sortable: true },
                    { field: 'ReturnDate', align: 'center', width: "100px" },
                    { field: 'FormDate', align: 'center', width: "100px" },
                    { field: 'SecretLevel', align: 'center', width: "100px" },
                    { field: 'Remark', align: 'left', width: "200px" },
                    { align: 'center', width: "100px", formatter: operateFormatter }
                ],
                toolbar: '#toolbar',//工具按钮用哪个容器
                buttonsClass: "sm btn-white",//按钮class
                pageSize: 100,//分页条数
                clickToSelect: true,//设置true将在点击行时，自动选择单选或复选框
                singleSelect: true,//为true则禁止多选
                cache: false,//是否缓存
                cookie: true,//是否启用cookie
                cookieIdTable: "EngDevice",//cookie键值
                pagination: true,//是否分页
                showColumns: true,//是否显示所有的列
                showRefresh: true,//是否显示刷新按钮
                search: true,//是否启用搜索
                showPaginationSwitch: true,//是否显示分页切换按钮
                showExport: true,//是否启用导出
                striped: false,//是否显示行间隔色
                onDblClickRow: function (row, obj) { //双击行事件
                    LookFile(row.FilePath, row.FileExt);
                },
                onSearch: function (text) {
                    if (text != "") {
                        $("#tabData tbody tr").each(function (z) {
                            $("td:not(.bs-checkbox)", this).each(function (i) {
                                if (i != 0) {
                                    var str = "<span class=\"bg-yellow\">" + text + "</span>";
                                    var NewText = $("#tabData tbody tr").eq(z).find("td").eq(i).text().replaceAll(text, str);
                                    $("#tabData tbody tr").eq(z).find("td").eq(i).html(NewText);
                                }
                            })
                        })
                    }
                }
            });
        })

        function operateFormatter(value, row, index) {
                <%if (IsEdit == 1) {
                %> return [
                    "<a title=\"修改\" class=\"text-success\" href=\"javascript:;\" onclick=\"showPage('修改电子档案信息','/scan5/EleFileEdit.aspx?ID=" + row.ID + "',800,550,true)\">编辑</a>&emsp;" +
                    "<a title=\"删除\" class=\"text-danger\" href=\"javascript:;\" onclick=\"_Confirm('确定要删除这条数据？',function(){ DelData('TElectronic','" + row.ID + "') })\">删除</a>"
                ];
                <%
            }

            % >
            }

        //设置快捷键
        document.onkeydown = function () {
            //焦点不在控件上的时候执行 if (document.activeElement.className.indexOf("form-control") == -1)

            {
                var keycode = window.event.keyCode;
                if (keycode == '<%=HotKey26 %>') {
                    $("#btnClose").click();
                    return false;
                }

                if (keycode == '<%=HotKey2 %>') {
                    $("#btnSearch").click();
                    return false;
                }

            }
        }
    </script>
}